package com.example.mapper;

import com.example.pojo.OrdSearch;
import com.example.pojo.Order;
import com.example.pojo.OrderDetails;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrderMapper {
    List<OrdSearch> getOrder(OrdSearch order);

    @Update("UPDATE indent set ordCode=#{ordCode},cusCode=#{cusCode},ordDate=#{ordDate},ordPrice=#{ordPrice} where ordCode=#{ordCode}")
    void changeOrder(Order order);

    @Delete("delete from indent where ordCode=#{id}")
    void deleteOrder(String id);

    @Insert("INSERT INTO indent values (0,#{cusCode},#{ordDate},#{ordPrice})")
    @Options(useGeneratedKeys = true, keyProperty = "ordCode")
    Integer addOrder(Order order);

}
